package com.cloudpivot.receivales.contract.repository.erpcontract;

import com.cloudpivot.receivales.contract.entity.erpcontract.CMContractMain;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * 合同信息主表 实体接口类
 */
@Repository

@Transactional(rollbackFor = Exception.class)
public interface CMContractMainRepository extends JpaRepository<CMContractMain,String> {

    @Modifying
    @Query(nativeQuery = true,value = "insert into CM_Contract_Main (strContractID, strRel, strSource, intDetail, intMustDetail, strTempleteShowID, strTempletePrintID, intKL, strSpare1, strSpare2, strSpare3, dblPreAPARCurrency, dblPreAPARCurrencyRMB) values (:strContractID,'0:','1','0','0','','','0','1','销售存货','1','0','0')")
    int addCMContractMain(@Param(value = "strContractID") String strContractID);
}
